home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / ab20 / ab20_archive / utilities / arexx / rexxarplib-2.52.lzh / rexx / getall.rexx < prev    next >
OS/2 REXX Batch file  |  1989-03-17  |  960b  |  50 lines

  1. /** getall.rexx
  2. *
  3. *   This function edits all specified files in which a certain
  4. *   string occurs, and puts the cursor at the first occurrence.
  5. *
  6. **/
  7. parse arg fn ss 
  8. ss = strip(ss)
  9.  
  10. options prompt "Next? "
  11.  
  12. if ss = "" then do
  13.    say "Usage: getall <wildcards> <search string>"
  14.    exit
  15. end
  16.  
  17. if ~show('l','rexxarplib.library') then addrexxlib
  18.  
  19. 'search 'fn' 'ss' quiet | execio stem files.'
  20.  
  21. if files.0 = 0 then do
  22.    call postmsg(100,100,"No files found")
  23.    call delay 120
  24.    call postmsg() 
  25.    exit
  26. end
  27.  
  28. do i = 1 to files.0
  29.    if files.i = "" then leave
  30.  
  31.    if i ~= 1 then do
  32.       call open(PULLWIN,"con:100/100/130/50/GetAll")
  33.       call writech(PULLWIN,"Next?  ")
  34.       yesno = readln(PULLWIN)
  35.       if left(yesno, 1) = 'n' then do
  36.          say "Aborted"
  37.          exit
  38.       end
  39.       call close(PULLWIN)
  40.    end
  41.    call setenv('Search', ss)
  42.    'e 'files.i' startup getall.txed sticky'
  43. end
  44.  
  45. call postmsg(100,100,"Done")
  46. call delay 120
  47. call postmsg()
  48.  
  49. exit
  50.